<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%@ include file="/common/operatehistory.jsp"%>
<%@ include file="/common/code.jsp"%>
<%@ include file="/common/user.jsp"%>
<%
    // 设置报告查看权限
	OperateHistory oh = OperateHistory.fromMap(parameters, OperateHistory.class);
    oh.setUid(token.getUid() + "");
    oh.setCategory(SECTION_DOCTOR);
    oh.setOperate(AUTH_REPORT);
	List<Map> attentionList = QBuilder.db("basedb").select().from("OperateHistory as o").where(new Where("o.hospital=", hospital).and("o.category=", SECTION_DOCTOR).and("o.operate=", ATTENTION).and("o.status=", STATUS_ENABLE).and("o.uid=", token.getUid()).and("o.oid=", oh.getOid())).query().getResultObj();
	if (attentionList.size() == 0 ) {
		Tools.encryptPrint(out, new Message(30041, "你还没有关注该医生，不能进行授权"));
		return;
	}
    Tools.encryptPrint(out, operate(oh, false));
%>
